package com.itheima.day04_array;

import java.util.Scanner;

public class Demo7_pingweidafen {
    public static void main(String[] args) {
        double[] scores = new double[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < scores.length; i++) {
            System.out.println("请您输入" + (i + 1) + "位评委的分数：");
            double score = scanner.nextDouble();
            scores[i] = score;
        }

        double sum = 0;
        for (int i = 0; i < scores.length; i++) {
            sum += scores[i];
        }
        System.out.println("sum = " + sum);
        System.out.println("(sum / scores.length) = " + (sum / scores.length));
    }
}
